using Furion.DistributedIDGenerator;
using Furion.DynamicApiController;
using Yitter.IdGenerator;

namespace Kevin.Dapr.Api.Controllers
{
    public partial class GuidController : IDynamicApiController
    {
        public List<string> GetGuidList()
        {
            var list = new List<string>();
            for (int i = 0; i < 1001; i++)
            {
                list.Add(_idGenerator.Create().ToString());
            }
            return list;
        }

        public List<string> GetShortIdList()
        {
            var list = new List<string>();
            for (int i = 0; i < 1001; i++)
            {
                list.Add(ShortIDGen.NextID());
            }
            return list;
        }

        public long GetLongId()
        {
            return YitIdHelper.NextId();
        }
    }

    public partial class GuidController
    {
        private readonly IDistributedIDGenerator _idGenerator;

        public GuidController(IDistributedIDGenerator idGenerator)
        {
            _idGenerator = idGenerator;
        }
    }
}
